/*
 * Justin Prentice
 * TCSS 305
 * Tetris gui - update class
 */

package view;

import java.util.List;

import model.Block;
import model.Piece;

/**
 * A class to contain update information from the tetris board.
 * @author Justin Prentice
 * @version 1.0
 */
public class TetrisUpdate
{
  /**
   * Describes whether the game is over (true) or not (false).
   */
  private final boolean my_gameover_state;
  
  /**
   * The piece currently being moved around.
   */
  private final Piece my_piece;
  
  /**
   * The upcoming piece.
   */
  private final Piece my_preview_piece;
  
  /**
   * The frozen pieces.
   */
  private final List<Block[]> my_blocks;
  
  /**
   * The board's width.
   */
  
  private final int my_width;
  
  /**
   * The board's height.
   */
  private final int my_height;
  
  private final int my_score;
  
  /**
   * Constructs an object with information about the current state of the game board.
   * @param the_gameover_state true if the game is over, false otherwise
   * @param the_piece the current piece
   * @param the_preview_piece the piece in preview
   * @param the_blocks the frozen blocks
   * @param the_width the board's width
   * @param the_height the board's height
   * @param the_score the user's current score
   */
  public TetrisUpdate(final boolean the_gameover_state, 
                      final Piece the_piece, 
                      final Piece the_preview_piece, 
                      final List<Block[]> the_blocks,
                      final int the_width,
                      final int the_height,
                      final int the_score)
  {
    super();
    my_gameover_state = the_gameover_state;
    my_piece = the_piece;
    my_preview_piece = the_preview_piece;
    my_blocks = the_blocks;
    my_width = the_width;
    my_height = the_height;
    my_score = the_score;
  }
  
  /**
   * Method to report if the game is over or not.
   * @return true if the game is over, false otherwise
   */
  public boolean gameOver()
  {
    return my_gameover_state;
  }
  
  /**
   * reports the piece currently in motion.
   * @return the piece in motion
   */
  public Piece getPiece()
  {
    return my_piece;
  }
  
  /**
   * reports the piece currently in motion.
   * @return the piece in motion
   */
  public Piece getPreviewPiece()
  {
    return my_preview_piece;
  }
  
  /**
   * returns the frozen pieces.
   * @return the frozen pieces
   */
  public List<Block[]> getBlocks()
  {
    return my_blocks;
  }
  
  /**
   * Reports the width of the tetris board.
   * @return the width
   */
  public int getWidth()
  {
    return my_width;
  }
  
  /**
   * Reports the height of the tetris board.
   * @return the height
   */
  public int getHeight()
  {
    return my_height;
  }
  
  /**
   * Reports the current score.
   * @return the score.
   */
  public int getScore()
  {
    return my_score;
  }
}
